﻿using System.Collections.ObjectModel;

namespace WpfApp1
{
    public class MainViewModel: ObservableObject
    {
        private ObservableCollection<MenuItem> _menuList = new ObservableCollection<MenuItem>();
        public ObservableCollection<MenuItem> MenuList
        {
            get => _menuList;
            set => SetProperty(ref _menuList, value);
        }
         
        private MenuItem _menuItem;
        public MenuItem MenuItem
        {
            get => _menuItem;
            set
            {
                SetProperty(ref _menuItem, value);

                switch (_menuItem.Name)
                {
                    case "TabControl": 
                        MainContent = new TabControlStyle();
                        break;
                    case "TabControl2":
                        MainContent = new TabControlStyle2();
                        break;
                    default:
                        break;
                }

            }
           
        }

        private object _mainContent;
        public object MainContent
        {
            get => _mainContent;
            set => SetProperty(ref _mainContent, value);
        }

        public MainViewModel()
        {
            MenuList.Add(new MenuItem("TabControl","TabControlStyle"));
            MenuList.Add(new MenuItem("TabControl2","TabControlStyle2")); 
        }
    }



    public class MenuItem
    {
        public MenuItem()
        {
            
        }
        public MenuItem(string name,string view)
        {
            Name = name;
            View = view;
        }
        public string Name { get; set; }
        public string View { get; set; } 
    }
}
